﻿using System;
using System.Windows.Data;
using System.Windows.Media;

namespace SmartController.Convertors
{
    public class BoolToColorValueConverter : IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (targetType != typeof(Brush))
                throw new InvalidOperationException("The target must be a brush");

            return ((bool)value) ? Brushes.Aquamarine : Brushes.White;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotSupportedException();
        }

        #endregion
    }
}
